Skip to content

Conversation

@BrennanConroy
Copy link
Member

We use inline pipe scheduling which means the StartStreamAsync call will call continuations inline which will add the stream to the connection before returning. However, inline continuations relies on a continuation actually being present. So all these tests relied on a race condition where we had an active pipeReader.ReadAsync call in order to call the continuation inline. If you add a delay or pause the thread right before the ReadAsync in Http2Connection.cs then you can force the race and cause _connection._streams[1]; to fail as there is no stream present yet.

The fix is to make sure the stream is present, and we attain that by making sure the app code is running which is after the stream has been created.

@BrennanConroy BrennanConroy added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jan 10, 2025
@BrennanConroy BrennanConroy merged commit 84fd1a4 into main Jan 14, 2025
27 checks passed
@BrennanConroy BrennanConroy deleted the brecon/kestrelstream branch January 14, 2025 00:06
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Jan 14, 2025
@danroth27 danroth27 added the task label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants